package com.flca.pstc42.dto;

import org.garret.perst.Persistent;

public class CityDto extends Persistent  {

	int cityId;
	String city;
	String province;
	
	
	
	public CityDto() {
		super();
	}
	
	
	public CityDto(int cityId, String city, String province) 
	{
		super();
		this.cityId = cityId;
		this.city = city;
		this.province = province;
	}


	public int getCityId() {
		return cityId;
	}
	public void setCityId(int cityId) {
		this.cityId = cityId;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	
	public String getData() {
		return city + ";" + province;
	}
	
	public static CityDto make(String aCsvLine)
	{
		CityDto result = new CityDto();
		
		String tokens[] = aCsvLine.split(";");
		
		result.setCityId(Integer.parseInt(tokens[0]));
		result.setCity(tokens[1]);
		result.setProvince(tokens[2]);
		
		return result;
	}}
